<?php
session_start();
$tk=$_POST["tk"];
$mk=$_POST["mk"];
	mysql_connect("localhost","root","");
	$ten=mysql_query("SELECT username,pass,ten FROM ajax.thanh_vien WHERE username='$tk'");
	$sodong=mysql_num_rows($ten);
	$row=mysql_fetch_array($ten);

		if($sodong!=0)
		{
			if($mk==$row["pass"])
			{
				$_SESSION["thanhvien"]=true;
				$_SESSION["ten"]=$row["ten"];
				$_SESSION["username"]=$row["username"];
				echo("thanhcong");
			}
			else
			{
				$_SESSION["thanhvien"]=false;
				echo("that bai");
			}
		}
		else
		{
			$_SESSION["thanhvien"]=false;
			echo ("that bai");
		}
	
?>